package com.bw.day03.adapter

import android.widget.RadioButton
import com.bw.base.net.entity.address
import com.bw.day03.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class AddressAdapter: BaseQuickAdapter<address, BaseViewHolder>(R.layout.item_address) {
    override fun convert(
        holder: BaseViewHolder,
        item: address
    ) {
        holder.setText(R.id.name,"收货人:${item.realName}  ${item.phone} ")
        holder.setText(R.id.dress,"收货地址:${item.province}${item.city}${item.district}${item.detail}")
        if (item.isDefault==true){
            var view = holder.getView<RadioButton>(R.id.rb)
            view.isChecked=true
        }
    }
}